package com.util;

import java.util.ResourceBundle;

public class ConfigUtil {

	/**
	 * 
	 * <p>功能描述：通过key值获得默认配置文件config.properties中某个key对应的值
	 * config.properties存于src根目录下
	 * </p>
	 * @param key
	 * @return key对应的值
	 * @author:zhuyoulong
	 * @update:[日期YYYY-MM-DD][更改人姓名][变更描述]
	 */
	public static String getConfigPropertyValue(String key){
		ResourceBundle config = ResourceBundle.getBundle("config");
		return config.getString(key);
	}
	
	public static String getMyConfigPropertyValue(String key){
		ResourceBundle myconfig = ResourceBundle.getBundle("myconfig");
		return myconfig.getString(key);
	}
	
	/**
	 * 
	 * <p>功能描述：通过key值获得指定配置文件中某个key对应的值</p>
	 * @param filename
	 * @param key
	 * @return
	 * @author:zhuyoulong
	 * @update:[日期YYYY-MM-DD][更改人姓名][变更描述]
	 */
	public static String getOtherPropertyValue(String filename,String key){
		ResourceBundle config = ResourceBundle.getBundle(filename);
		return config.getString(key);
	}
}
